using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace My.IdlConverter.LoadManager
{
    public class DefaultConfigStrategy : ConfigStrategy
    {
        public DefaultConfigStrategy()
        {
        }

        public override void Makedisable()
        {
            UserComponent component = Check<UserComponent>();

            component.LoadBehavior = false;
            component.Path = FileRenamer.Rename(component.Path);
        }

        public override void Makeable()
        {
            UserComponent component = Check<UserComponent>();

            component.LoadBehavior = true;
            component.Path = FileRenamer.Retain(component.Path);
        }

        public override void Delete()
        {
            UserComponent component = Check<UserComponent>();

            if (File.Exists(component.Path))
            {
                component.LoadBehavior = false;
                File.Delete(component.Path);
            }
        }
    }
}
